package xyz.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

import xyz.entity.Note;

@Dao
public interface NoteDao {
    @Insert
    long insert(Note model);


    @Query("select * from note where id=:id")
    Note getNote(int id);

    @Query("select * from note where id=:id")
    LiveData<Note> getLiveNote(int id);


    @Update
    int updateNote(Note note);

    @Query("select * from note")
    List<Note> getAll();


    @Query("select * from note")
    LiveData<List<Note>> getAllNote();

    @Delete
    int delete(Note note);
}
